package com.pengtu.gsj.service.impl.system;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.pengtu.gsj.dao.system.WarningDao;
import com.pengtu.gsj.entity.app.Warning;
import com.pengtu.gsj.service.system.WarningService;

@Service
@Transactional
public class WarningServiceImpl implements WarningService {
	@Autowired
	private WarningDao warningDao;

	@Override
	public void save(Warning warning) {
		warningDao.save(warning);
	}

	@Override
	public Warning getWarningByProject(String projectId) {
		return warningDao.findUniqueBy("projectId", projectId);
	}

	/**
	 * 
	 * getWarnings:
	 * 适用:获取所有没有关闭的预警  按时间排序
	 * @return 
	 * @exception 
	 * @since  1.0.0
	 */
	@Override
	public List<Warning> getWarnings() {
		return warningDao.getWarnings();
	}
	
	
	
}
